Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
PhotoSwipe | create Title Element | Responsive

i want to add an Title Element below my Image Gallery created with PhotoSwipe. But my Title Element sticks not under the Image. It sticks to fast in the Image when Browser rescaling vertically.

JS to create the Element:

            lightbox.pswp.ui.registerElement({
                name: 'werkInformationen',
                className: 'smallWerkInformationen',
                appendTo: 'wrapper',
                onInit: (el, pswp) => {
                    var wrapDiv = document.createElement('div');
                    wrapDiv.className = 'wrapDiv';

                    var popUp = document.createElement('div');
                    popUp.className = 'popUpWerkInformationenTitle';
                    popUp.id = 'popUpWerkInformationenTitle';

                    var span = document.createElement('span');
                    span.className = 'child';
                    span.id = 'popUpWerkInformationenTitleSpan';
                    
                    wrapDiv.appendChild(popUp);
                    popUp.appendChild(span);

                    el.appendChild(wrapDiv);

                    pswp.on('change', (a,) => {
                        var paramsFromCurrentWerk = new URLSearchParams(lightbox.pswp.currSlide["data"]["src"]);
                        document.getElementById("popUpWerkInformationenTitleSpan").innerHTML = paramsFromCurrentWerk.get('id') + " | " + paramsFromCurrentWerk.get('werkName') + " | " + paramsFromCurrentWerk.get('material') + " | " + paramsFromCurrentWerk.get('kuenstler');
                    });
                }
            });

Output to HTML:

<div class="smallWerkInformationen pswp__hide-on-close">
    <div class="wrapDiv">
        <div class="popUpWerkInformationenTitle">
            <span class="child">PLACEHOLDER TEXT</span>
        </div>
    </div>
</div>

CSS:

.wrapDiv {
    min-width: 600px;
}

.smallWerkInformationen {
    position: relative;
}

#popUpWerkInformationenTitle {
    font-size: 12px;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

#popUpWerkInformationenTitleSpan {
    text-align: center;
    background-color: black;
    color: #fff;
    border-radius: 5px;
    margin-left: 15px;
    margin-right: 15px;
    margin-top: 15px;
    font-size: 1rem !important;
    padding: 5px;
}

Expected Result until there is no space: Expected Result until there is no space

My Result:
There is enough Space to fit the Text Element below but it goes in the Image.

My Result

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There is already an Caption example. But not that exactly what i want.

https://photoswipe.com/caption/

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda